<?php

namespace App\controller;

use App\model\GameLog;
use support\Request;
use support\Response;

class LogController extends CommonController
{
    /**
     * 加入游戏
     * @param Request $request
     * @return Response
     */
    public function record(Request $request)
    {
        $data = $request->postData;

        print_r($data);
        $uuid = $data['uuid'] ?? '';
        $nickname = $data['nickname'] ?? '';
        $role_id = $data['role_id'] ?? '';
        $content = $data['content'] ?? '';

        GameLog::create([
            'uuid' => $uuid,
            'nickname' => $nickname,
            'type' => 1,
            'content' => $data['content'] ?? '',
        ]);
        return outJson(0, '创建成功！');
    }

}
